<!DOCTYPE html>
<html lang="zh">

<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>页面</title>
    <script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/loading.js"></script>
    <link href="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/lib/theme-chalk/index.css" rel="stylesheet">


</head>
<style>
    .el-input {
        width: 80%
    }

    .el-row {
        margin-bottom: 20px;
    }

    .el-col {
        border-radius: 4px;
    }

    .bg-purple-dark {
        background: #99a9bf;
    }

    .bg-purple {
        background: #d3dce6;
    }

    .bg-purple-light {
        background: #e5e9f2;
    }

    .grid-content {
        border-radius: 4px;
        min-height: 36px;
    }

    .row-bg {
        padding: 10px 0;
        background-color: #f9fafc;
    }
</style>

<body>
<div id="app">
    <el-container v-loading="loading">
        <el-header>
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">合作商管理</el-breadcrumb-item>
                <el-breadcrumb-item>企业管理</el-breadcrumb-item>
                <el-breadcrumb-item>企业新增</el-breadcrumb-item>
            </el-breadcrumb>
        </el-header>

        <el-main>
            <el-form ref="companyForm" :model="companyForm" :rules="companyFormRule" label-width="30%">
                <el-row>
                    <el-col>
                        <el-steps :active="1" simple>
                            <el-step title="公司基本信息" icon="el-icon-edit"></el-step>
                        </el-steps>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="公司名称" prop="company_name">
                            <el-input v-model="companyForm.company_name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="组织机构代码" prop="company_code">
                            <el-input v-model="companyForm.company_code"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="营业执照注册号" prop="company_num">
                            <el-input v-model="companyForm.company_num"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="企业性质" prop="company_type">
                            <el-select v-model="companyForm.company_type" filterable placeholder="请选择"
                                       style="width:100%">
                                <el-option v-for="item in nature" :key="item.company_type" :label="item.company_type"
                                           :value="item.company_type">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="街道信息" prop="company_address">
                            <el-input v-model="companyForm.company_address"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="营业执照及组织代码附件">
                            <el-upload :on-success="getUrl" action="/order/file.json"
                                       :before-upload="beforeAvatarUpload"
                                       :on-remove="handleRemove" :on-exceed="onExceed" multiple :limit="1"
                                       list-type="picture-card">
                                <el-button size="small" type="primary">点击上传</el-button>
                            </el-upload>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="24" :md="24" :lg="2" :xl="2">
                        <el-button type="primary" plain disabled>经营类型</el-button>
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="14" :xl="12" style="text-align:left">
                        <el-form-item prop="company_manage_types" label-width="0px">
                            <el-checkbox-group v-model="companyForm.company_manage_types">
                                <el-checkbox v-for="city in manage_types" :label="city" :key="city" border>{{city}}
                                </el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                    </el-col>
                    <#--<el-col :xs="4" :sm="4" :md="4" :lg="4" :xl="4">-->
                        <#--<el-form-item label="其他" label-width="50px">-->
                            <#--<el-input v-model="aa" style="width:100px">-->
                            <#--</el-input>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="24" :md="24" :lg="2" :xl="2">
                        <el-button type="primary" plain disabled>企业资质</el-button>
                    </el-col>
                    <#--<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">-->
                        <#--<el-form-item label="开发资质" prop="company_exploit">-->
                            <#--<el-select v-model="companyForm.company_exploit" filterable placeholder="请选择">-->
                                <#--<el-option v-for="item in aptitude" :key="item.company_type" :label="item.company_type"-->
                                           <#--:value="item.company_type">-->
                                <#--</el-option>-->
                            <#--</el-select>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                    <#--<el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">-->
                        <#--<el-form-item label="装饰等级" prop="company_decoration">-->
                            <#--<el-select v-model="companyForm.company_decoration" filterable placeholder="请选择">-->
                                <#--<el-option v-for="item in aptitude" :key="item.company_type" :label="item.company_type"-->
                                           <#--:value="item.company_type">-->
                                <#--</el-option>-->
                            <#--</el-select>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                    <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                        <el-form-item label="施工资质" prop="company_construction">
                            <el-select v-model="companyForm.company_construction" filterable placeholder="请选择">
                                <el-option v-for="item in aptitude" :key="item.company_type" :label="item.company_type"
                                           :value="item.company_type">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="上一年度销售额" prop="company_lastyear_sale">
                            <el-input v-model.number="companyForm.company_lastyear_sale" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                <#--<el-form-item label="上年材料设备采购余额（万元）" prop="company_lastyear_balance">-->
                <#--<el-input v-model.number="companyForm.company_lastyear_balance" autocomplete="off"></el-input>-->
                <#--</el-form-item>-->
                <#--</el-col>-->
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="本年度计划销售目标" prop="company_objective">
                            <el-input v-model.number="companyForm.company_objective" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="土地储备可持续开发时间" prop="company_explit_year">-->
            <#--<el-input v-model.number="companyForm.company_explit_year" autocomplete="off"-->
            <#--placeholder="请输入数字，单位：年"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
                <el-row>
                    <el-col>
                        <el-steps :active="1" simple>
                            <el-step title="财务信息" icon="el-icon-edit"></el-step>
                        </el-steps>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="开户行名称" prop="company_bankcard_name">
                            <el-input v-model="companyForm.company_bankcard_name"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="银行卡号" prop="company_bankcard_num">
                            <el-input v-model="companyForm.company_bankcard_num" autocomplete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="统一社会信用代码" prop="company_credit_code">
                            <el-input v-model="companyForm.company_credit_code"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="纳税人识别号" prop="company_people_code">
                            <el-input v-model="companyForm.company_people_code"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <#--<el-row>-->
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                        <#--<el-form-item label="纳税人名称" prop="company_people_name">-->
                            <#--<el-input v-model="companyForm.company_people_name"></el-input>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                        <#--<el-form-item label="纳税人资质" prop="company_people_resource">-->
                            <#--<el-select v-model="companyForm.company_people_resource" filterable placeholder="请选择"-->
                                       <#--style="width:100%">-->
                                <#--<el-option v-for="item in people_resource" :key="item.type" :label="item.type"-->
                                           <#--:value="item.type">-->
                                <#--</el-option>-->
                            <#--</el-select>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                <#--</el-row>-->
                <#--<el-row>-->
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                        <#--<el-form-item label="增值税专用发票最高额（元）" prop="company_invoice_price">-->
                            <#--<el-input v-model.number="companyForm.company_invoice_price" autocomplete="off"></el-input>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                    <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                        <#--<el-form-item label="税控机类型" prop="company_invoice_type">-->
                            <#--<el-select v-model="companyForm.company_invoice_type" filterable placeholder="请选择"-->
                                       <#--style="width:100%">-->
                                <#--<el-option v-for="item in invoice_type" :key="item.label" :label="item.label"-->
                                           <#--:value="item.label">-->
                                <#--</el-option>-->
                            <#--</el-select>-->
                        <#--</el-form-item>-->
                    <#--</el-col>-->
                <#--</el-row>-->
                <el-row>
                    <el-col>
                        <el-steps :active="1" simple>
                            <el-step title="负责人联系方式" icon="el-icon-edit"></el-step>
                        </el-steps>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="姓名" prop="company_principal_name">
                            <el-input v-model="companyForm.company_principal_name"></el-input>
                        </el-form-item>
                    </el-col>
                <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
                <#--<el-form-item label="部门" prop="company_principal_dept">-->
                <#--<el-input v-model="companyForm.company_principal_dept"></el-input>-->
                <#--</el-form-item>-->
                <#--</el-col>-->
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="职位" prop="company_principal_position">
                            <el-input v-model="companyForm.company_principal_position"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="* 手机" prop="company_principal_phone">
                            <el-input v-model="companyForm.company_principal_phone"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
                        <el-form-item label="邮箱" prop="company_principal_email">
                            <el-input v-model="companyForm.company_principal_email"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="地址" prop="company_principal_address">-->
            <#--<el-input v-model="companyForm.company_principal_address"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->

            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col>-->
            <#--<el-steps :active="1" simple>-->
            <#--<el-step title="紧急联系人" icon="el-icon-edit"></el-step>-->
            <#--</el-steps>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="姓名" prop="company_emergency_name">-->
            <#--<el-input v-model="companyForm.company_emergency_name"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="部门" prop="company_emergency_dept">-->
            <#--<el-input v-model="companyForm.company_emergency_dept"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="职位" prop="company_emergency_position">-->
            <#--<el-input v-model="companyForm.company_emergency_position"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="* 手机" prop="company_emergency_phone">-->
            <#--<el-input v-model="companyForm.company_emergency_phone"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
            <#--<el-row>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="地址" prop="company_emergency_address">-->
            <#--<el-input v-model="companyForm.company_emergency_address"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">-->
            <#--<el-form-item label="邮箱" prop="company_emergency_email">-->
            <#--<el-input v-model="companyForm.company_emergency_email"></el-input>-->
            <#--</el-form-item>-->
            <#--</el-col>-->
            <#--</el-row>-->
                <el-row>
                    <el-form-item>
                        <el-button type="primary" @click="submitForm('companyForm')">立即创建</el-button>
                        <a onclick="javascript:history.back(-1);">
                            <el-button>返回</el-button>
                        </a>
                    </el-form-item>
                </el-row>
            </el-form>
        </el-main>
        <el-footer>

        </el-footer>
    </el-container>
</div>

<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/dist/vue.js"></script>
<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/vue-element/lib/index.js"></script>
<script src="https://pinzafile.oss-cn-shanghai.aliyuncs.com/publiccss/assets/global/plugins/jquery.min.js"
        type="text/javascript"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            //手机格式验证
            // var checkPhone = (rule, value, callback) => {
            //     if (!value) {
            //         return callback(new Error('手机号不能为空'));
            //     } else {
            //         const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
            //         console.log(reg.test(value));
            //         if (reg.test(value)) {
            //             callback();
            //         } else {
            //             return callback(new Error('请输入正确的手机号'));
            //         }
            //     }
            // };
            return {
                loading: false,
                companyFormRule: {
                    company_name: [{
                        required: true,
                        message: '请输入公司名称',
                        trigger: 'blur'
                    }],
                    // company_code: [{
                    //     required: true,
                    //     message: '请输入组织机构代码',
                    //     trigger: 'blur'
                    // }],
                    // company_num: [{
                    //     required: true,
                    //     message: '请输入营业执照注册号',
                    //     trigger: 'blur'
                    // }],
                    // company_type: [{
                    //     required: true,
                    //     message: '请选择企业性质',
                    //     trigger: 'change'
                    // }],
                    // company_address: [{
                    //     required: true,
                    //     message: '请输入地址',
                    //     trigger: 'blur'
                    // }],
                    // company_pic_url: [{
                    //     required: true,
                    //     message: '请上传营业执照及组织代码附件',
                    //     trigger: 'change'
                    // }],
                    // company_manage_types: [{
                    //     type: 'array',
                    //     required: true,
                    //     message: '请至少选择一个经营类型',
                    //     trigger: 'change'
                    // }],
                    // company_exploit: [{
                    //     required: true,
                    //     message: '请选择开发资质',
                    //     trigger: 'change'
                    // }],
                    // company_decoration: [{
                    //     required: true,
                    //     message: '请选择装饰等级',
                    //     trigger: 'change'
                    // }],
                    // company_construction: [{
                    //     required: true,
                    //     message: '请选择施工资质',
                    //     trigger: 'change'
                    // }],
                    // company_lastyear_sale: [{
                    //     required: true,
                    //     message: '请输入上一年度销售额',
                    //     trigger: 'blur'
                    // }],
                    // company_lastyear_balance: [{
                    //     required: true,
                    //     message: '请输入上年材料设备采购余额（万元）',
                    //     trigger: 'blur'
                    // }],
                    // company_objective: [{
                    //     required: true,
                    //     message: '请输入本年度计划销售目标',
                    //     trigger: 'blur'
                    // }],
                    // company_explit_year: [{
                    //     type: 'number',
                    //     message: '必须为数字值'
                    // }],
                    company_bankcard_name: [{
                        required: true,
                        message: '请输入开户行名称',
                        trigger: 'blur'
                    }],
                    company_bankcard_num: [{
                        required: true,
                        message: '请输入银行卡号',
                        trigger: 'blur'
                    }],
                    company_credit_code: [{
                        required: true,
                        message: '请输入统一社会信用代码',
                        trigger: 'blur'
                    }],
                    company_people_code: [{
                        required: true,
                        message: '请输入纳税人识别号',
                        trigger: 'blur'
                    }],
                    // company_people_name: [{
                    //     required: true,
                    //     message: '请输入纳税人名称',
                    //     trigger: 'blur'
                    // }],
                    // company_people_resource: [{
                    //     required: true,
                    //     message: '请输入纳税人资质',
                    //     trigger: 'blur'
                    // }],
                    // company_invoice_price: [{
                    //     required: true,
                    //     message: '请输入增值税专用发票最高额（元）',
                    //     trigger: 'blur'
                    // }],
                    // company_invoice_type: [{
                    //     required: true,
                    //     message: '请选择税控机类型',
                    //     trigger: 'change'
                    // }],
                    // company_principal_name: [{
                    //     required: true,
                    //     message: '请输入姓名',
                    //     trigger: 'blur'
                    // }],
                    // company_principal_dept: [{
                    //     required: true,
                    //     message: '请输入部门',
                    //     trigger: 'blur'
                    // }],
                    company_principal_position: [{
                        required: true,
                        message: '请输入职位',
                        trigger: 'blur'
                    }],
                    // company_principal_phone: [{
                    //     validator: checkPhone,
                    //     trigger: 'blur'
                    // }],
                    // company_principal_address: [{
                    //     required: true,
                    //     message: '请输入地址',
                    //     trigger: 'blur'
                    // }],
                    // company_emergency_name: [{
                    //     required: true,
                    //     message: '请输入姓名',
                    //     trigger: 'blur'
                    // }],
                    // company_emergency_dept: [{
                    //     required: true,
                    //     message: '请输入部门',
                    //     trigger: 'blur'
                    // }],
                    // company_emergency_position: [{
                    //     required: true,
                    //     message: '请输入职位',
                    //     trigger: 'blur'
                    // }],
                    // company_emergency_phone: [{
                    //     validator: checkPhone,
                    //     trigger: 'blur'
                    // }],
                    // company_emergency_address: [{
                    //     required: true,
                    //     message: '请输入地址',
                    //     trigger: 'blur'
                    // }]
                },
                //
                manage_types: ['住宅开发', '商业开发', '产业开发', '商业运营', '施工总承包', '装修', '办公','其他'],
                //纳税人资质
                // people_resource: [{
                //     type: '一般纳税人'
                // }, {
                //     type: '资深纳税人'
                // }],
                //企业性质
                nature: [{
                    company_type: '民营企业'
                }, {
                    company_type: '国有企业'
                }, {
                    company_type: '外资企业'
                }],
                //企业资质
                aptitude: [{
                    company_type: '一级'
                }, {
                    company_type: '二级'
                }, {
                    company_type: '三级'
                }],
                //税控机类型
                // invoice_type: [{
                //     label: '一级'
                // }, {
                //     label: '二级'
                // }, {
                //     label: '三级'
                // }, {
                //     label: '四级'
                // }, {
                //     label: '五级'
                // }],
                //表单内容
                companyForm: {
                    company_name: '',
                    company_code: '',
                    company_num: '',
                    company_type: '',
                    company_address: '',
                    company_pic_url: '',
                    company_manage_types: [],
                    company_manage_type: '',
                    company_exploit: '开发资质（该字段已作废）',
                    company_decoration: '装饰等级（该字段已作废）',
                    company_construction: '',
                    company_lastyear_sale: '',
                    company_lastyear_balance: '上年材料设备采购余额（该字段已作废）',
                    company_objective: '',
                    company_explit_year: '土地储备可持续开发时间（该字段已作废）',
                    company_bankcard_name: '',
                    company_bankcard_num: '',
                    company_credit_code: '',
                    company_people_code: '',
                    company_people_name: '纳税人名称（该字段已作废）',
                    company_people_resource: '纳税人资质（该字段已作废）',
                    company_invoice_price: '5000000',
                    company_invoice_type: '税控机类型（该字段已作废）',
                    company_principal_name: '',
                    company_principal_dept: '负责人部门（该字段已作废）',
                    company_principal_position: '',
                    company_principal_phone: '',
                    // company_principal_street: '',
                    company_principal_email: '',
                    company_principal_address: '负责人地址（该字段已作废）',
                    company_emergency_name: '紧急联系人姓名（该字段已作废）',
                    company_emergency_dept: '紧急联系人部门（该字段已作废）',
                    company_emergency_position: '紧急联系人职位（该字段已作废）',
                    company_emergency_phone: '紧急联系人联系方式（该字段已作废）',
                    // company_emergency_street: '',
                    company_emergency_email: '紧急联系人邮箱（该字段已作废）',
                    company_emergency_address: '紧急联系人地址（该字段已作废）'
                },
                aa: "",
            };

        },
        methods: {
            onExceed(files, fileList) {
                this.$message({
                    type: 'info',
                    message: '最多只能上传一个文件',
                    duration: 6000
                });
            },
            beforeAvatarUpload(file) {
                const isLt2M = file.size / 1024 / 1024 < 2;

                if (!isLt2M) {
                    this.$message.error('文件大小不能超过 2MB!');
                }
                return isLt2M;
            },
            getUrl(file) {
                this.file = file;
            },
            handleRemove(file) {
                var bool = false;
                var err = "系统异常！";
                $.ajax({
                    url: '/order/delFile.json',
                    type: 'post',
                    data: {path: file.response},
                    async: false,
                    dataType: 'json',
                    success: function (result) {
                        if (result.ret) {
                            bool = true;
                        } else {
                            err = result.msg;
                        }
                    }
                });
                if (bool) {
                    this.$message({
                        message: "操作成功",
                        type: 'success'
                    });
                } else {
                    this.$message({
                        message: err,
                        type: 'error'
                    });
                }
            },
            submitForm: function (formName) {
                this.loading = true;
                var tempForm = this.companyForm;
                var ids = tempForm.company_manage_types.toString();
                tempForm.company_manage_type = ids;
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        $.ajax({
                            url: '/company/add.json',
                            type: 'POST',
                            data: tempForm,
                            success: (result) => {
                                this.loading = false;
                                if (result.ret) {
                                    this.$message({
                                        message: '添加成功',
                                        type: 'success'
                                    });
                                    setTimeout(function () {
                                        window.location.href = "/company/list.page";
                                    }, 1000);
                                } else {
                                    this.$message.error("请求超时，请稍后重试");
                                }
                            }
                        });

                    } else {
                        this.loading = false;
                        this.$message({
                            message: '警告，请填写必填字段',
                            type: 'warning'
                        });
                        return false;
                    }
                });

            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },
            handleRemove(file, fileList) {
                console.log(file, fileList);
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            },
            //鼠标监听input框事件
            inputFunc($event) {
                this.companyForm.company_manage_types.push($event)
            }

        }
    })
</script>
</body>

</html>